package Ass1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Bai2_Giaithua {
	public static long getFatorial(int value){
		long result = 1;
		do{
			result = result * value;
			--value;
		}while(value > 1);
		return result;
	}
	
	public static void main(String[] args) {
		System.out.print("Nhập số: ");
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			int value = Integer.parseInt(br.readLine());
			System.out.println("Giai thừa của " + value + " là "
							+ Bai2_Giaithua.getFatorial(value));
		}catch(NumberFormatException e){
			e.printStackTrace();
		}catch (IOException e) {
			e.printStackTrace();
		}

	}
}
